package com.lss.cloud.controller;

import com.lss.cloud.Resp.ResultData;
import com.lss.cloud.service.AccountService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2024/3/26-23:28
 * 功能:
 */
@RestController
@Slf4j
public class AccountController {
    @Resource
    private AccountService accountService;
    @PostMapping("/account/decrease")
    ResultData decrease(@RequestParam("userId") Long userId, @RequestParam("money") Long money){
        log.info("-------------------->开始进行account修改 userId:{},money:{}",userId,money);
        accountService.decrease(userId,money);
        log.info("-------------------->account修改结束");
        return ResultData.success("扣减账户余额成功！");
    }
}
